<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('自增ID');
            $table->string('username', 100)->unique()->comment('用户名');
            $table->string('password', 255)->comment('密码');
            $table->string('salt', 255)->comment('盐值');
            $table->dateTime('last_login_at')->comment('最近登录时间');
            $table->string('last_login_ip', 50)->comment('最近登录ip');
            $table->dateTime('deleted_at')->nullable()->comment('删除标记');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('admins');
    }
}
